package collection;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 数组进行流式操作
 */
public class StreamAPIDemo4 {
    public static void main(String[] args) {
        Integer[] array = {1,2,3,4,5,6,7,8};
        //变成流，利用数组工具类，Arrays.把它转换为流
        List<Integer> list = Arrays.stream(array)
                             .filter(e->e%2==0)
                             .map(e->e*3)
                             .collect(Collectors.toList());
        System.out.println(list);
    }
}
